<template>
  <div class="easyd-weixin-Box">
    <div class="incomeAndExpensesSelectDate">当前
      <b>2012</b> 年，
      <span>
        <i class="fa fa-calendar fa-lg"></i>切换年份
      </span>
    </div>
    <div class="incomeAndExpensesHistoryBox">
      <mt-loadmore
        :top-method="loadTop"
        :bottom-method="loadBottom"
        :bottom-all-loaded="allLoaded"
        ref="loadmore"
        >
        <div class="incomeAndExpensesHistoryItem" v-for="i in 10">
          <div class="incomeAndExpensesYearMonth">2012年12月</div>
          <div class="incomeAndExpensesPrice">1000元</div>
          <div class="incomeAndExpensesPreview">查看详细</div>
        </div>
      </mt-loadmore>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      allLoaded: false
    };
  },
  methods: {
    addShopClick() {
      this.$router.push({
        path: "/addShop"
      });
    },
    loadTop() {
      setTimeout(() => {
        this.$refs.loadmore.onTopLoaded();
      }, 2000);
    },
    loadBottom() {
      setTimeout(() => {
        this.allLoaded = true;
        this.$refs.loadmore.onBottomLoaded();
      }, 5000);
    }
  }
};
</script>

<style lang="stylus" scoped>
@import '~PUBLIC_CSS'
.incomeAndExpensesSelectDate {
  width: 100%;
  height: 50px;
  text-align: center;
  line-height: 50px;

  i {
    font-size: 14px;
    position: relative;
    top: -2px;
    margin-right: 5px;
  }

  span {
    color: orange;
  }
}

.incomeAndExpensesHistoryBox {
  position: absolute;
  top: 50px;
  bottom: 0px;
  left: 0px;
  box-sizing: border-box;
  padding-left: 15px;
  padding-right: 15px;
  right: 0px;
  overflow: auto;
  -webkit-overflow-scrolling : touch;

  .incomeAndExpensesHistoryItem {
    width: 100%;
    height: 50px;
    display: flex;
    box-sizing border-box
    padding-left: 10px;
    padding-right: 10px;
    $itemStyle()
    margin-bottom: 15px;

    .incomeAndExpensesYearMonth {
      flex: 3;
      height: 50px;
      text-align: left;
      line-height: 50px;
    }

    .incomeAndExpensesPrice {
      flex: 4;
      height: 50px;
      text-align: right;
      line-height: 50px;
    }

    .incomeAndExpensesPreview {
      flex: 2;
      height: 50px;
      text-align: right;
      line-height: 50px;
    }
  }
}
</style>

